<template>
  <div class="about">
    <h1>This is an about page</h1>
    <ul>
      <li v-for="(item, index) in $store.state.data" :key="index">
        {{ item.title }}
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    // this.$axios.get("data.json").then((res) => {
    //   this.$store.commit("setdata", res.data.list);
    // });
    //一进入页面就请求数据 把请求到的数据 发送给 vuex存储

    this.$store.dispatch("getdata");
    //调用 action请求 axios
  },
};
</script>
